package com.hanfu.ucenter.web.web.controller;

import com.hanfu.ucenter.web.exception.UCenterException;
import com.hanfu.ucenter.web.web.dto.Request.ReqMemberAuthentication;
import com.hanfu.ucenter.web.web.dto.Response.RespMemberAuthentication;
import com.hanfu.ucenter.web.web.param.UserDto;
import com.hanfu.ucenter.web.web.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by dufei on 19/9/18.
 */
@RestController
@RequestMapping(method = RequestMethod.POST, value = "/uCenter/MemberAuthentication")
public class MemberAuthenticationController extends UCenterBaseController<ReqMemberAuthentication,RespMemberAuthentication> {

    @Autowired
    private MemberService memberService;

    @Override
    protected RespMemberAuthentication doService(ReqMemberAuthentication req, HttpServletRequest httpServletRequest, UserDto userInfo) throws UCenterException {
        req.setMemberId(userInfo.getId());
        memberService.SubmitAuthentication(req);
        RespMemberAuthentication resp = new RespMemberAuthentication();
        return resp;
    }





}
